package com.example.wangandroid.data.model

import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope

import com.example.common.TreeClass

import com.kongzue.dialogx.dialogs.TipDialog
import com.kongzue.dialogx.dialogs.WaitDialog
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import kotlinx.coroutines.withContext


class ItemViewModel : ViewModel() {

    private val _treeClassResult = MutableLiveData<TreeClass?>()
    val TreeClassRusult: LiveData<TreeClass?> = _treeClassResult

    fun getIteminfo(){
//        viewModelScope.launch {
//
//            withContext(Dispatchers.IO){
//                try {
//                    val res= HttpMothod.getDetailedTree() ?: return@withContext
//                    if(res.errorCode == 0){
//                        WaitDialog.dismiss()
//                        _treeClassResult.postValue(res)
//                    }else{
//                        TipDialog.show(res.errorMsg.toString())
//                    }
//                }catch (_:java.lang.Exception){
//
//                }
//            }
//        }
    }


}